﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace ISFProject.Models
{
    public class City
    {   [Key]
        public int Id { get; set; }
         [Required(ErrorMessage = "name is missing")]
         [StringLength(60, MinimumLength = 3, ErrorMessage = "Invalid fieldlength")]
        public string Name { get; set; }
         [Required(ErrorMessage = "AreaCode is missing")]
         [Range(1000,9000)]
        public int AreaCode { get; set; }
        [ForignKey("Country")];
        public int CountryId { get; set; }
        public virtual Country Country { get; set; }

        public virtual List<Address> Addresses { get; set; }
    }
}